﻿CREATE TABLE [dbo].[SpecialitatiPersoane] (
    [IDPersSpecialitate] INT      IDENTITY (1, 1) NOT NULL,
    [IdPersoana]         INT      NOT NULL,
    [DataObtinere]       DATETIME CONSTRAINT [DF_SpecialitatiPersoane_DataObtinere] DEFAULT (getdate()) NOT NULL,
    [LuniVechime]        SMALLINT CONSTRAINT [DF_SpecialitatiPersoane_LuniVechime] DEFAULT ((0)) NOT NULL,
    [IDSpecialitate]     INT      NOT NULL,
    [Principala]         BIT      CONSTRAINT [DF_SpecialitatiPersoane_Principala] DEFAULT ((0)) NOT NULL,
    CONSTRAINT [PK_SpecialitatiPersoane] PRIMARY KEY CLUSTERED ([IDPersSpecialitate] ASC),
    CONSTRAINT [FK_SpecialitatiPersoane_Persoane] FOREIGN KEY ([IdPersoana]) REFERENCES [dbo].[Persoane] ([IdPersoana]),
    CONSTRAINT [FK_SpecialitatiPersoane_TipSpecialitati] FOREIGN KEY ([IDSpecialitate]) REFERENCES [dbo].[TipSpecialitati] ([IdSpecialitate])
);

